import { readable } from 'svelte/store';

let _pixelRatio = undefined;

if (_pixelRatio === undefined) {
	if (typeof window === 'undefined') {
		_pixelRatio = 2;
	} else {
		_pixelRatio = window.devicePixelRatio;
	}
}

export const pixelRatio = readable(_pixelRatio);

export const imageBasePath = readable('/assets/images');

const _variables = {
	siteName: import.meta.env.VITE_SITE_NAME,
	wechatQRCode: import.meta.env.VITE_WX_QR_CODE
};

export const variables = readable(_variables);
